package club.lovety.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Created by smc on 2018/2/25.
 */
@SpringBootApplication
@EnableDiscoveryClient
public class WebApplication {

    private static final Logger log = LoggerFactory.getLogger(WebApplication.class);

    @LoadBalanced
    @Bean
    public RestTemplate createRestTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        log.info("开始启动接口服务");
        SpringApplication.run(WebApplication.class,args);
        log.info("启动接口服务成功");
    }
}
